<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
	<head>
		<title>JSP for CustViewAtomForm form</title>
		<LINK href="css/default.css" rel=stylesheet>
		<script language="javascript" type="text/javascript">
		function opchange(o){
			document.custviewForm.method.value=o;
			document.custviewForm.submit();
		}
		</script>
	</head>
	<body>
		<table width="880" cellspacing="0" cellpadding="0" border="0">
			<tbody>
				<tr>
					<td width="3" height="31">
						<img height="31" src="./images/table_01.gif" width="3" />
					</td>
					<td background="./images/table_02.gif" height="31">
						<table cellspacing="0" cellpadding="0" width="146" align="left"
							border="0">
							<tbody>
								<tr>
									<td width="51" background="./images/title_1_bg.gif">
										<img height="31" src="./images/title_1.gif" width="51" />
									</td>
									<td width="95" background="./images/title_1_bg.gif">
										<span class="color_b_666">视图业务原子</span>
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td width="3">
						<img height="31" src="./images/table_03.gif" width="3" />
					</td>
				</tr>
				<tr>
					<td width="3" background="./images/table_04.gif" width="3"
						align="right">
						<img height="100%" src="./images/table_04.gif" width="3" />
					</td>
					<td>
						<html:form action="/custview">
							<logic:present name="cimpagelist">
								<table width="770" border="0" align="center" cellpadding="5"
									cellspacing="1" bgcolor="#FF9900">
									<tr>
										<th>
											选择客户视图：
											<logic:iterate name="cimpagelist" id="cp">
												<html:link
													href="custview.do?method=custviewatom&pageid=${cp.pageId}&clutype=${clutype}">
													<logic:equal name="pageid" value="${cp.pageId}">
														<font color="#ff0000">
													</logic:equal>
													<bean:write name="cp" property="pageName" />
													<logic:equal name="pageid" value="cp.pageId">
														</font>
													</logic:equal>
												</html:link>
											</logic:iterate>
											<logic:present name="pageid">
												<img src='images/button_modify.gif' width="63" height="21" onclick="opchange('save')" />
											</logic:present>
										</th>
									</tr>
								</table>

								<logic:present name="pageid">
									<logic:present name="atomlist">
										<div id="id1" align="center">
											<table width="770" border="0" align="center" cellpadding="5"
												cellspacing="1" bgcolor="#FF9900">
												<%
												int i = -1, j = 0;
												%>
												<logic:iterate name="atomlist" id="cpl">
													<%
															j = 0;
															if (-1 == i) {
																i++;
																out.print("<tr>");
															}
													%>
													<logic:present name="pageatomlist">
														<logic:iterate name="pageatomlist" id="ccpl">
															<logic:equal name="ccpl" property="bizAtomId" value="${cpl.BIZ_ATOM_ID}">
																<%
																j = 1;
																%>
															</logic:equal>
														</logic:iterate>
													</logic:present>
													<td>
														<input type="checkbox" id="cimatoms" name="cimatoms"
															value="<bean:write name="cpl" property="BIZ_ATOM_ID" />"
															<%=(1 == j ? "checked" : "")%> />
														<bean:write name="cpl" property="BIZ_ATOM_NAME" />
														（
														<bean:write name="cpl" property="BAS_TABLE_NAME" />
														）
													</td>
													<%
															i = (i + 1) % 4;
															if (0 == i)
																out.print("</tr><tr>");
													%>
												</logic:iterate>
												<%
													while (i++ < 4) out.print("<td></td>");
												%>
												</tr>
											</table>
										</div>
									</logic:present>
								</logic:present>
							</logic:present>
							<logic:notPresent name="cimpagelist">
								<div align="center">
									未设定任何客户视图页面，无法添加业务原子，请先添加客户视图页面。
								</div>
							</logic:notPresent>
							<html:hidden property="method" value="save" />
							<html:hidden property="pageid" value="${pageid}" />
							<html:hidden property="clutype" value="${clutype}" />
						</html:form>
					</td>
					<td background="./images/table_05.gif" width="3" align="left">
						<img height="100%" src="./images/table_05.gif" width="3">
					</td>
				</tr>
				<tr>
					<td height=3 valign="top">
						<img height="12px" src="./images/table_06.gif" width="3px">
					</td>
					<td height=3 valign="top">
						<img height="3px" src="./images/table_07.gif" width="100%">
					</td>
					<td height=3 valign="top">
						<img height="12px" src="./images/table_08.gif" width="3px">
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>

